package com.yjz.designpattern.decorator_pattern;

public class DecoratorDemo {
    public static void main(String[] args) {
        TextEditor editor = new SimpleTextEditor();
        TextEditor editorWithPermission = new PermissionDecorator(editor);
        TextEditor editorWithCache = new CacheDecorator(editorWithPermission);

        System.out.println(editorWithCache.edit("Hello World"));
    }
}